package com.esri.core.portal;

import java.util.EnumSet;
import java.util.Iterator;

/* loaded from: classes.dex */
public enum PortalAccess {
    PRIVATE("private"),
    SHARED("shared"),
    ORGANIZATION("org"),
    PUBLIC("public");
    
    String a;

    PortalAccess(String str) {
        this.a = str;
    }

    @Override // java.lang.Enum
    public String toString() {
        return this.a;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static PortalAccess a(String str, boolean z) {
        if (str == null) {
            return null;
        }
        Iterator it = EnumSet.allOf(PortalAccess.class).iterator();
        while (it.hasNext()) {
            PortalAccess portalAccess = (PortalAccess) it.next();
            if (portalAccess.toString().equals(str)) {
                return portalAccess;
            }
        }
        if (z && str.equalsIgnoreCase("ORGANIZATION")) {
            return ORGANIZATION;
        }
        return null;
    }
}
